package com.leoman.dao;

import com.leoman.entity.Admin;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * AdminDao
 * Created by 涂奕恒 on 2016/11/23 0023 下午 3:40.
 */
public interface AdminDao extends JpaRepository<Admin, Integer>, JpaSpecificationExecutor<Admin> {

    @Query("select a from Admin a where a.account = ?1")
    Admin findOneByAccount(String account);

    @Query("select a from Admin a where a.mobile = ?1")
    Admin findOneByMobile(String mobile);
}